#include<stdio.h>
#include<math.h>
int main()
{
    double i=1.0,a,sum,m;
    double eps;
    scanf("%lf",&eps);
    while(i>eps)
    {
        m=1.0/(3.0*a+1.0)*pow(-1,a);
        
        sum=sum+m;
        a++;
    }
printf("sum = %.6lf",sum);
return 0;
}
